package com.party.core.service.order.impl;

import com.party.common.paging.Page;
import com.party.common.utils.StringUtils;
import com.party.common.utils.UUIDUtils;
import com.party.core.dao.read.order.OrderFormSubInfoReadDao;
import com.party.core.dao.write.order.OrderFormSubInfoWriteDao;
import com.party.core.model.order.OrderFormSubInfo;
import com.party.core.service.order.IOrderFormSubInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * 订单附属信息
 *
 * @author Administrator
 */
@Service
public class OrderFormSubInfoService implements IOrderFormSubInfoService {

    @Autowired
    OrderFormSubInfoReadDao orderFormSubInfoReadDao;

    @Autowired
    OrderFormSubInfoWriteDao orderFormSubInfoWriteDao;


    @Override
    public OrderFormSubInfo getOrderWithMember(String orderId, Integer type) {
        return orderFormSubInfoReadDao.getOrderWithMember(orderId, type);
    }

    @Override
    public String insert(OrderFormSubInfo orderFormSubInfo) {
        if (StringUtils.isEmpty(orderFormSubInfo.getId())) {
            orderFormSubInfo.setId(UUIDUtils.generateRandomUUID());
        }
        if (null == orderFormSubInfo.getCreateDate()) {
            orderFormSubInfo.setCreateDate(new Date());
        }
        boolean result = orderFormSubInfoWriteDao.insert(orderFormSubInfo);
        if (result) {
            return orderFormSubInfo.getId();
        }
        return null;
    }

    @Override
    public boolean update(OrderFormSubInfo orderFormSubInfo) {
        return false;
    }

    @Override
    public boolean deleteLogic(String id) {
        return false;
    }

    @Override
    public boolean delete(String id) {
        return false;
    }

    @Override
    public boolean batchDeleteLogic(Set<String> ids) {
        return false;
    }

    @Override
    public boolean batchDelete(Set<String> ids) {
        return false;
    }

    @Override
    public OrderFormSubInfo get(String id) {
        return null;
    }

    @Override
    public List<OrderFormSubInfo> listPage(OrderFormSubInfo orderFormSubInfo, Page page) {
        return null;
    }

    @Override
    public List<OrderFormSubInfo> list(OrderFormSubInfo orderFormSubInfo) {
        return null;
    }

    @Override
    public List<OrderFormSubInfo> batchList(Set<String> ids, OrderFormSubInfo orderFormSubInfo, Page page) {
        return null;
    }
}
